package cn.edu.dz.mmcock;

public class Mother extends Thread {
    private  Kitchen kitchen;

    public Mother(Kitchen kitchen) {
        super("妈妈");
        //守护线程
        this.setDaemon(true);
        this.kitchen = kitchen;

    }

    public  void cock()throws InterruptedException{
        this.kitchen.do_cock();
    }

    @Override
    public void run() {
        while (true){
            try{
                this.cock();
            }catch (InterruptedException e){
             e.printStackTrace();
            }
        }
    }
}
